﻿using BackupContracts.Sql;
using BackupContracts.Tasks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;

namespace BackupContracts.Services
{
    [ServiceContract]
    public interface IBackupService
    {
        [OperationContract]
        bool CheckCredentials();

        [OperationContract]
        void UpsertSqlServer(SqlServer sqlServer);

        [OperationContract]
        void DeleteSqlServer(string serverId);

        [OperationContract]
        List<SqlServer> ListSqlServers();

        [OperationContract]
        List<SqlDatabaseBackup> ListDatabaseBackups(string serverName, string databaseName);

        [OperationContract]
        List<SqlDatabaseBackupLog> ListDatabaseBackupLogs(string serverName, string databaseName, string backupId);

        [OperationContract]
        List<SqlDatabase> ListDatabases(string serverName);

        [OperationContract]
        string GetPublicBlobUrl(string blobUrl);

        [OperationContract]
        List<SqlDatabase> ListSqlDatabases(string serverId);

        [OperationContract]
        void UpsertTask(Task task);

        [OperationContract]
        void DeleteTask(string taskId);

        [OperationContract]
        List<Task> ListTasks();

        [OperationContract]
        void CopyAndBackupToBlob(string serverName, string databaseName, string loginId, string password, string storageAccount, string storageKey, string container, int maxHistory);
    }
}
